package com.teamit.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.teamit.entity.Employee;
import com.teamit.entity.Project;
import com.teamit.service.ProjectService;
import com.teamit.util.web.ServletUtil;

public class MainServlet extends HttpServlet {

	
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		Employee employee = (Employee) request.getSession().getAttribute("curr_employee");
		ProjectService ps = new ProjectService();
		
		List<Project> projectList = ps.findProject(employee.getId());
		request.setAttribute("projectList", projectList);
		ServletUtil.forword(request, response, "main");
		
	}
}